package config;

import psg.servicemanager.ServiceManager;
import java.net.*;


// Segregate Context Assignment from MCS API
public class Static_Context {

	public static ServiceManager getServiceManager(String nam, int listeningPort/*, String psgName, String psgIP, int psgPort*/) throws UnknownHostException{
		
		String domains [] = { "person"};
		String attrs [][] = {
				        {
				    		"name", // the name of an entity (in all context domains)
				    		"preference",
				    		"speed",
				    		"visitingSpace",
				    		"location",
				    		"psgPowerLevel",
				    		"action",
				    		"mood",
				    		"isBusy",
				    		"SOLEConnectivity",
				    		"MACAddress",
//				    		"phonePickedUp",
//				    		"tvOn",
//				    		"foodOnTable",
//				    		"personAtDoor",
//				    		"personEating",
//				    		"personDrinking",
//				    		"IP",
//				    		"Port",
				        },						 
							};
		String valueTypes [][] = {
									{"String","String","String","String","String","String","String","String","String","String","String"},
								};
						
		int EventServerSocketPort = listeningPort+10000;
		
		ServiceManager sm = new ServiceManager(nam, domains, attrs, valueTypes, EventServerSocketPort);
		
		sm.cds.assign("person","name", PSG_Configuration.PSGName);
		sm.cds.assign("person","preference", "computing@computing");
		//InetAddress ownIP=InetAddress.getLocalHost();
//		sm.cds.assign("home","IP", PSG_Configuration.PSGIP);//ownIP.getHostAddress());  // 1st April 2010, Ivan
//		sm.cds.assign("home","Port", PSG_Configuration.PSGPort);  // 1st April 2010, Ivan		
		return sm;
		
	}
	
}
